import request from '@/utils/request.js'
/* 封装登录请求的方法 */
export const login = (data) => {
  return request({
    url: '/login',
    method: 'post',
    data

  })
}
/* 封装获取菜单数据的方法 */
export const menus = () => {
  return request({
    url: '/menus',
    method: 'get'
  })
}
/* 获取统计数据 */
export const getData = () => {
  return request({
    url: '/reports/type/1',
    method: 'get'
  })
}
/* 获取商品分类数据 */
export const getCateList = () => {
  return request({
    url: '/categories',
    method: 'get'
  })
}
/* 获取动态参数数据 */
export const getParams = (data) => {
  return request({
    url: `/categories/${data.id}/attributes`,
    method: 'get',
    params: {
      sel: data.sel
    }
  })
}
/* 修改动态参数数据 */
export const updateParams = (data) => {
  return request({
    url: `/categories/${data.id}/attributes/${data.attrId}`,
    method: 'put',
    data
  })
}
